package com.lkm.asking.service.Impl;

import com.lkm.asking.dao.DownFileDao;
import com.lkm.asking.entity.DownFile;
import com.lkm.asking.service.DownFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DownFileServiceImpl implements DownFileService {
    @Autowired
    DownFileDao downFileDao;

    @Override
    public int addDown(DownFile downFile) {
        return downFileDao.insertDown(downFile);
    }


    @Override
    public int countbyDataid(Integer dataid) {
        return 0;
    }

    @Override
    public int countbyUsername(String username) {
        return 0;
    }

    @Override
    public List<DownFile> listbyDataid(Integer dataid) {
        return null;
    }

    @Override
    public List<DownFile> ListbyUsername(String username) {
        return null;
    }

    @Override
    public int alreadyDown(Integer dataid, String username) {
        DownFile downFile = downFileDao.alreadyDown(dataid,username);
        if(downFile==null) return 0;
        else return downFile.getId();
    }
}
